<template>
    <div>
        <h2>1.axios</h2>
        <button @click="hdClick1">发送get</button>
        <button @click="hdClick2">发送post</button>
    </div>
</template>

<script>
    import axios from 'axios'
    export default {
        name: '',
        components: {

        },
        props: {

        },
        data() {
            return {

            };
        },
        methods: {
            hdClick1(){
                axios.get('/getdata',{
                    params:{
                        id:123
                    }
                })
            },
            hdClick2(){
                axios.post('/login',{
                    username:'111',
                    pwd:'123'
                })
            }
        }
    };
</script>

<style scoped lang="less">

</style>